GBML manual / Drawing

sprite_height

The height of a sprite asset, in pixels — the same size the editor’s art already has for spr itself, whether or not any instance is currently showing it.

Syntax

sprite_height(spr) -> int

Arguments

NameType
sprsprite

Returns

int

Description

The height of a sprite asset, in pixels - the same size the editor's art already has for spr itself, whether or not any instance is currently showing it.

Example

y = room_bottom() - sprite_height(spr_doc_hero) / 2;

Puts this instance against the room's bottom edge the same way sprite_width puts it against the right edge. The room's y counts down from its top-left corner, so room_bottom() is the bottom edge, and the instance sits half a sprite's height above it.

On the GBA

Same compile-time read as sprite_width — see its own gba note.

See also: sprite_widthsprite_framesroom_height